<ui:composition template="/WEB-INF/templates/main-template.xhtml"
	xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:p="http://primefaces.org/ui">
	
	<ui:define name="sidebar">
		<ui:include src="/WEB-INF/templates/public-sidebar.xhtml" />
	</ui:define>
	<ui:define name="content">
	<h:form>
	 <h:outputText value="Team Calendar" styleClass="outputTextTitle"/>
	 
	 	
	 <p:tabView id="tabView" > 
	 
	 	<p:tab id="tab1" title="Employee Details" >  
			 
			<!-- COMPETENCY EMPLOYEE SKILLS LIST -->
             <p:dataTable id="emplyeeDetails" value="#{teamCalendarBean.competencyEmployeeList}" var="employees">  
	  
		           
		           <p:column> 
		               <f:facet name="header">  
		            		<h:outputText value="S.No" />  
		       		   </f:facet>  
		                <h:outputText value="#{employees.sNo}" />
		            </p:column>  
		           
		            <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Emp. Code" />  
		       		    </f:facet>  
		                <h:outputText value="#{employees.employee.employeeCode}" />
		            </p:column>  
		  
		            <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Employee Name" />  
		       		    </f:facet>  
		                <h:outputText value="#{employees.employee.firstName} #{employees.employee.lastName}" />  
		            </p:column> 
		            
		            <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Module" />  
		       		    </f:facet>  
		                <h:outputText value="#{employees.employee.moduleName}" />  
		            </p:column>  
		            
		            <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Designation" />  
		       		    </f:facet>  
		                <h:outputText value="#{employees.employee.designation}" />  
		            </p:column> 
		            
		            <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Project Name" />  
		       		     </f:facet>  
		                <h:outputText value="#{employees.project}" />  
		            </p:column> 
		            
		            <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="Project Manager" />  
		       		    </f:facet>  
		                <h:outputText value="#{employees.projectManager.firstName} #{employees.projectManager.lastName}" />  
		            </p:column> 
		            
		            <p:column> 
		               <f:facet name="header">  
		            		<h:outputText value="Start Date" />  
		       		   </f:facet>  
		               <h:outputText value="#{employees.startDate}" >
		                	<f:convertDateTime pattern="dd-MMM-yyyy"/>  
		               </h:outputText>
		            </p:column> 
		            
		            <p:column> 
		            	<f:facet name="header">  
		            		<h:outputText value="End Date" />  
		       		   </f:facet>  
		                <h:outputText value="#{employees.endDate}" >
		                	<f:convertDateTime pattern="dd-MMM-yyyy"/>  
		                </h:outputText>  
		            </p:column> 
		            
		            <p:column>
		               <f:facet name="header">  
		            		<h:outputText value="Employee Status" />  
		       		   </f:facet>  
		                <h:outputText value="#{employees.employeeStatus}" />  
		            </p:column> 
		           		          
	            </p:dataTable>  
	            <h:commandLink>  
		            <p:graphicImage value="/resources/styles/images/excel.png" title="Export to Excel"/>  
		            <p:dataExporter type="xls" target="emplyeeDetails" fileName="Competency_Employees" />  
		        </h:commandLink>  
				
				</p:tab> 
				
				<p:tab id="tab2" title="Attendance"> 
					
					<h:panelGrid columns="3">
						<h:outputLabel value="Choose Date :" />
						<p:calendar value="#{teamCalendarBean.date}" pattern="dd-MM-yyyy"/> 
						<p:commandButton value="Search"  action="#{teamCalendarBean.getEmployeeLeavesAction}" update="@form"/>
					</h:panelGrid>
					
				   <p:dataTable value="#{teamCalendarBean.competencyLeavesList}" var="empLeave" >  
	  
		           <p:column headerText="Employee Code"> 
		                <h:outputText value="#{empLeave.employee.employeeCode}" />
		            </p:column>  
		  
		            <p:column headerText="Employee Name"> 
		                <h:outputText value="#{empLeave.employee.firstName} #{empLeave.employee.lastName}" />  
		            </p:column> 
		            
		            <p:column headerText="Module Name">
		                <h:outputText value="#{empLeave.employee.moduleName}" />  
		            </p:column>  
		            
		            <p:column headerText="Leave Type">
		                <h:outputText value="#{empLeave.leaveType.displayname}" />  
		            </p:column> 
		            
		            <p:column headerText="Leave From">
		                <h:outputText value="#{empLeave.periodFrom}" >
		                	<f:convertDateTime pattern="dd-MM-yyyy"/>
		                </h:outputText>  
		            </p:column> 
		            
		            <p:column headerText="Leave To">
		                <h:outputText value="#{empLeave.periodTo}" >
		                	<f:convertDateTime pattern="dd-MM-yyyy"/>
		                </h:outputText>    
		            </p:column> 
		            
		            <p:column headerText="Leave Status">
		                <h:outputText value="#{empLeave.approvalStatus}" />  
		            </p:column> 		            
		          
		           		          
	            </p:dataTable>  
	             
				
				</p:tab>
			
			</p:tabView>
          
         
	</h:form>
	</ui:define>
</ui:composition>

